package cn.edu.whut.system.controller;

import cn.edu.whut.commonapi.core.api.ApiResult;
import cn.edu.whut.system.service.ISysUserService;
import cn.edu.whut.system.vo.user.SysUserReq;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import static cn.edu.whut.commonapi.core.api.ApiResult.success;

@Tag(name = "系统服务 - 用户管理")
@RequestMapping("user")
@RestController
@RequiredArgsConstructor
public class SysUserController {

    private final ISysUserService sysUserService;

    @PostMapping("v1/create")
    @Operation(summary = "新增用户")
    public ApiResult<Integer> createUser(@RequestBody SysUserReq sysUserReq) {
        return success(sysUserService.createUser(sysUserReq));
    }
}
